#include "ObserverBoss.h"
#include <algorithm>
#include "Ahuman.h"

CObserverBoss::CObserverBoss(void)
{
}


CObserverBoss::~CObserverBoss(void)
{
}

void 
CObserverBoss::Notify()
{
	std::list<Ahuman*>::iterator itor = humanList.begin();
	for(; itor != humanList.end(); itor++)
	{
		(*itor)->Update(this);
	}
}

void 
CObserverBoss::Attach(Ahuman* human)
{
	humanList.push_back(human);
}

void 
CObserverBoss::Detach(Ahuman* human)
{
	std::list<Ahuman*>::iterator itor = find(humanList.begin(), humanList.end(), human);
	if(itor != humanList.end())
	{
		humanList.erase(itor);
	}
}

void 
CObserverBoss::setAction(const std::string action)
{
	mAction = action;
}

std::string 
CObserverBoss::getAction()const
{
	return mAction;
}